#!/bin/bash

####################################################
#         HoneyViz Installation Script             #
#                           v. 1.00                #
####################################################

#				Please Enjoy!
#
#
#				Lucas McDaniel
#				8/17/2011
#

DB_USER='root'
DB_PASS='rootpass'

#	Setup main database with "create_honeyviz.sql"

mysql -u $DB_USER --password=$DB_PASS < create_honeyviz.sql

mysql -u $DB_USER --password=$DB_PASS locations < create_locations.sql

mysql --max_allowed_packet=32M -u $DB_USER --password=$DB_PASS locations < create_lookup.sql

mysql -u $DB_USER --password=$DB_PASS honeyviz < create_dionaea.sql

#	Create uploader user

mysql -u $DB_USER --password=$DB_PASS -e "CREATE USER 'uploader'@'localhost' IDENTIFIED BY 'pass'"

mysql -u $DB_USER --password=$DB_PASS -e "GRANT SELECT ON locations.* TO 'uploader'"

